package com.class5.springboot.frame.repo.real;

import java.util.ArrayList;
import java.util.List;

import com.google.common.base.Preconditions;

/**
 * 批量操作语句
 * @author Administrator
 *
 */
public class BatchSql {
    //执行的SQL语句
    private String sql;
    //批量参数
    private List<Object[]> batchParams = new ArrayList<Object[]>();
    public String getSql() {
        return sql;
    }
    public void setSql(String sql) {
        this.sql = sql;
    }
    public BatchSql addBatchParam(List<Object> paramList){
        Preconditions.checkNotNull(paramList);
        this.batchParams.add(paramList.toArray());
        return this;
    }
    public List<Object[]> getBatchParams() {
        return batchParams;
    }
    @Override
    public String toString() {
        return "BatchSql [sql=" + sql + ", batchParams=" + batchParams + "]";
    }
}
